package com.atguigu.dga230315.governance.demo;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegexpDemo {
    public static void main(String[] args) {
        String email = "ZhangJY0819@126.cn";
        Pattern pattern = Pattern.compile("^\\w+@\\w{1,16}\\.(com|org|cn)$");

        Matcher matcher = pattern.matcher(email);
        boolean matches = matcher.matches();
        System.out.println(matches);
    }
}
